package com.winning.vsts.merge.service.entity;

import com.winning.vsts.merge.service.domain.VstsRequest;
import com.winning.vsts.merge.service.domain.WorksItem;

import java.io.Serializable;

/**
 * 工作项信息
 *
 * @author xcl <xcl@winning.com.cn>
 * @date 2021/11/18
 */
public class WorkItemDO implements Serializable {
    private static final long serialVersionUID = 6619211776129252608L;


    /**
     * vsts 任务id
     */
    private String itemId;
    /**
     * vsts 需求id
     */
    private String requestId;
    /**
     * 拉取请求ID
     */
    private String pullRequestId;
    /**
     * 项目ID
     */
    private Integer projectId;
    /**
     * 项目名称
     */
    private String projectName;
    /**
     * 任务名称
     */
    private String itemName;
    /**
     * 每次合并的批次号
     */
    private String pullNo;

    /**
     * vsts 需求id
     */
    private String requestName;
    /**
     * 需求迭代号
     */
    private String iterationNo;
    /**
     * 任务解决者
     */
    private String itemSolver;
    /**
     * 任务解决时间
     */
    private String itemSolverDate;
    /**
     * 需求解决者
     */
    private String requestSolver;
    /**
     * 需求解决时间
     */
    private String requestSolverDate;
    /**
     * 需求负责人
     */
    private String requestAssigner;
    /**
     * 工作项类型
     */
    private String itemType;
    /**
     * 需求类型
     */
    private String requestType;
    /**
     * 工作项状态
     */
    private String itemStatus;
    /**
     * 需求状态
     */
    private String requestStatus;
    /**
     * 任务负责人
     */
    private String itemAssigner;
    /**
     * 任务url
     */
    private String itemUrl;
    /**
     * 需求url
     */
    private String requestUrl;


    public WorksItem createWorksItem() {
        WorksItem worksItem = new WorksItem();
        worksItem.setVstsId(this.itemId);
        worksItem.setItemName(this.itemName);
        worksItem.setProjectId(this.projectId);
        worksItem.setProjectName(this.projectName);
        worksItem.setPullNo(this.pullNo);
        worksItem.setIterationNo(this.iterationNo);
        worksItem.setRequestId(this.requestId);
        worksItem.setStatus(this.itemStatus);
        worksItem.setType(this.itemType);
        worksItem.setSolver(this.itemSolver);
        worksItem.setSolveDate(this.itemSolverDate);
        worksItem.setUrl(this.itemUrl);
        return worksItem;
    }

    public VstsRequest createRequestByItem() {
        VstsRequest vstsRequest = new VstsRequest();
        vstsRequest.setVstsId(this.itemId);
        vstsRequest.setRequestName(this.itemName);
        vstsRequest.setPullNo(this.pullNo);
        vstsRequest.setIterationNo(this.iterationNo);
        vstsRequest.setStatus(this.itemStatus);
        vstsRequest.setType(this.itemType);
        vstsRequest.setSolver(this.itemSolver);
        vstsRequest.setSolveDate(this.itemSolverDate);
        vstsRequest.setAssigner(this.itemAssigner);
        vstsRequest.setUrl(this.itemUrl);
        return vstsRequest;
    }

    public VstsRequest createRequest() {
        VstsRequest vstsRequest = new VstsRequest();
        vstsRequest.setVstsId(this.requestId);
        vstsRequest.setRequestName(this.requestName);
        vstsRequest.setPullNo(this.pullNo);
        vstsRequest.setIterationNo(this.iterationNo);
        vstsRequest.setStatus(this.requestStatus);
        vstsRequest.setType(this.requestType);
        vstsRequest.setSolver(this.requestSolver);
        vstsRequest.setSolveDate(this.requestSolverDate);
        vstsRequest.setAssigner(this.requestAssigner);
        vstsRequest.setUrl(this.requestUrl);
        return vstsRequest;
    }


    public String getItemId() {
        return itemId;
    }

    public void setItemId(String itemId) {
        this.itemId = itemId;
    }

    public String getRequestId() {
        return requestId;
    }

    public void setRequestId(String requestId) {
        this.requestId = requestId;
    }

    public String getItemName() {
        return itemName;
    }

    public String getPullRequestId() {
        return pullRequestId;
    }

    public void setPullRequestId(String pullRequestId) {
        this.pullRequestId = pullRequestId;
    }

    public Integer getProjectId() {
        return projectId;
    }

    public void setProjectId(Integer projectId) {
        this.projectId = projectId;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public void setItemName(String itemName) {
        this.itemName = itemName;
    }

    public String getPullNo() {
        return pullNo;
    }

    public void setPullNo(String pullNo) {
        this.pullNo = pullNo;
    }

    public String getRequestName() {
        return requestName;
    }

    public void setRequestName(String requestName) {
        this.requestName = requestName;
    }

    public String getIterationNo() {
        return iterationNo;
    }

    public void setIterationNo(String iterationNo) {
        this.iterationNo = iterationNo;
    }

    public String getItemSolver() {
        return itemSolver;
    }

    public void setItemSolver(String itemSolver) {
        this.itemSolver = itemSolver;
    }

    public String getItemSolverDate() {
        return itemSolverDate;
    }

    public void setItemSolverDate(String itemSolverDate) {
        this.itemSolverDate = itemSolverDate;
    }

    public String getRequestSolver() {
        return requestSolver;
    }

    public void setRequestSolver(String requestSolver) {
        this.requestSolver = requestSolver;
    }

    public String getRequestSolverDate() {
        return requestSolverDate;
    }

    public void setRequestSolverDate(String requestSolverDate) {
        this.requestSolverDate = requestSolverDate;
    }

    public String getRequestAssigner() {
        return requestAssigner;
    }

    public void setRequestAssigner(String requestAssigner) {
        this.requestAssigner = requestAssigner;
    }

    public String getItemType() {
        return itemType;
    }

    public void setItemType(String itemType) {
        this.itemType = itemType;
    }

    public String getRequestType() {
        return requestType;
    }

    public void setRequestType(String requestType) {
        this.requestType = requestType;
    }

    public String getItemStatus() {
        return itemStatus;
    }

    public void setItemStatus(String itemStatus) {
        this.itemStatus = itemStatus;
    }

    public String getRequestStatus() {
        return requestStatus;
    }

    public void setRequestStatus(String requestStatus) {
        this.requestStatus = requestStatus;
    }

    public String getItemAssigner() {
        return itemAssigner;
    }

    public void setItemAssigner(String itemAssigner) {
        this.itemAssigner = itemAssigner;
    }

    public String getItemUrl() {
        return itemUrl;
    }

    public void setItemUrl(String itemUrl) {
        this.itemUrl = itemUrl;
    }

    public String getRequestUrl() {
        return requestUrl;
    }

    public void setRequestUrl(String requestUrl) {
        this.requestUrl = requestUrl;
    }
}
